package com.dj;


import com.dj.servlet.MyServlet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan("com.dj")
public class CommonConfig {

    @Autowired
    private MyServlet myServlet;

    @Bean
    ServletRegistrationBean registerBean(){
        ServletRegistrationBean registrationBean = new ServletRegistrationBean(myServlet,"/*");
        return registrationBean;
    }

}
